<link rel="stylesheet" type="text/css" href="/static/plugins/editormd/css/editormd.min.css">
<link rel="stylesheet" href="/static/plugins/form-selects/form-selects.v4.css">
<div class="layui-card layadmin-tabs-card">
    <div class="layui-card-header">
        <span class="layui-breadcrumb">
            <a href="/management/index">首页</a>
            <a><cite>发布内容</cite></a>
            <a><cite>发布博文</cite></a>
        </span>
    </div>
</div>
<div class="layui-fluid layadmin-container" id="NB-article-post-tab">
    <div class="layui-row">
        <div id="article-post" class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-header layui-elip">开始书写一篇新的文章</div>
                <div class="layui-card-body">
                    <div class="layui-form">
                        <div class="layui-form-item layui-col-sm8">
                            <label class="layui-form-label">标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="title" required lay-verify="required" placeholder="请输入标题"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">自定义链接</label>
                            <div class="layui-input-block">
                                <input type="checkbox" lay-skin="switch"
                                       lay-filter="customUrl" lay-text="自定义|自动生成">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-sm8" style="display: none;" id="urlSequence">
                            <label class="layui-form-label">文章短网址</label>
                            <div class="layui-input-block">
                                <input type="text" name="urlSequence" placeholder="输入文章短网址，示例：/article-example-url"
                                       autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md6">
                            <label class="layui-form-label">分类</label>
                            <div class="layui-input-block">
                                <select name="cateId" lay-verify="required" lay-search>
                                    <option value="">请选择</option>
                                    <option th:each="cate,cateStat:${cateList}" th:value="${cate.id}"
                                            th:text="${cate.cnName}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">封面</label>
                            <div class="layui-upload-drag" id="coverImg">
                                <i class="layui-icon"></i>
                                <p>点击上传博文封面，或将封面拖拽到此处</p>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">编辑器类型</label>
                            <div class="layui-input-block">
                                <input type="radio" name="editor" value="markdown" title="markdown编辑器" checked
                                       lay-filter="editor">
                                <input type="radio" name="editor" value="html" title="富文本编辑器"
                                       lay-filter="editor">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">内容</label>
                            <div class="layui-input-block" id="content-editor" style="max-width: 1366px;">
                                <textarea id="editor" placeholder="输入内容" style="display: none;"></textarea>
                            </div>
                        </div>
                        <textarea id="editormd-markdown-doc" name="editormd-markdown-doc"
                                  style="display:none;"></textarea>
                        <textarea id="editormd-html-code" name="editormd-html-code" style="display:none;"></textarea>
                        <div class="layui-form-item">
                            <label class="layui-form-label">开启摘要</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="autoSummary" lay-skin="switch"
                                       lay-filter="summary" lay-text="手动撰写|自动生成">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text" id="article-summary" style="display: none;">
                            <label class="layui-form-label">文章摘要</label>
                            <div class="layui-input-block">
                            <textarea name="summary" placeholder="如果不填，则取文章内容的开头小部分（不包含图片以及文字格式）" class="layui-textarea"
                                      style="resize: none;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-sm8">
                            <label class="layui-form-label">标签</label>
                            <div class="layui-input-block">
                                <select name="tagNames"
                                        xm-select="tags"
                                        xm-select-max="4"
                                        xm-select-search=""
                                        xm-select-create=""
                                        xm-select-search-type="dl">
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">评论功能</label>
                                <div class="layui-inline">
                                    <input type="checkbox" name="commented" value="true" lay-skin="switch"
                                           lay-text="开启|关闭"
                                           title="评论">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">打赏功能</label>
                                <div class="layui-inline">
                                    <input type="checkbox" name="appreciable" value="true" lay-skin="switch"
                                           lay-text="开启|关闭" title="打赏">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="postSubmit">立即发布</button>
                                <button class="layui-btn layui-btn-primary" lay-submit lay-filter="draftSubmit">保存草稿
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/plugins/nkeditor/libs/JDialog/JDialog.min.js"></script>
<script src="/static/plugins/nkeditor/NKeditor-all-min.js"></script>

